package com.zking.service;

import java.util.Date;
import java.util.List;

import com.zking.model.Answerquestions;
import com.zking.model.Collects;
import com.zking.model.Questions;
import com.zking.util.AppException;

public interface QuestionService {
	//提问题
	public int tquestion(Questions question) throws AppException;
	//显示所有问题
	public  List<Questions> showquestion() throws AppException;
	//通过问题ID查找问题的详细信息
	public Questions selectQuestionsByqid(int qId) throws AppException;
	
	//用户回答问题的内容存入数据库
	public int answerquestion(Answerquestions answerquestion)throws AppException;
	
	//根据qid查找问题的回答信息 
	public List<Answerquestions> selectByqid(int qId) throws AppException;
	
	//根据uId查找用户提过的问题
	public List<Questions> selectByuid(int uId)throws AppException;
	//验证用户是否已经收藏了问题
	public int collects (Collects collect)throws AppException;
	
	//查找用户所以收藏的问题
	public List<Collects> selectAllByuid(int qId)throws AppException;
	
	//根据cId来删除用户的收藏
	public int deletecollect(int cId)throws AppException;
	//根据qId来删除用户提过的问题
	public int deletequestion(int qId)throws AppException;
	//根据aId找到被采纳的答案
	public Answerquestions selectanswer(int aId,int qId,int uId)throws AppException;
	//根据qId修改用户状态
	public int updateanswer(int qId,int qDostate)throws AppException;
	//根据aId修改答案状态
	public int updateanswerdostate(int aId,int aDostate)throws AppException;
	//根据状态查找所以的问题
	public List<Questions> selectbydostate(int qDostate)throws AppException;
	//根据qId查找所有的回答并计数
	public int selectByqidCount(int qId)throws AppException;
	//根据qId查找所有的收藏并计数
	public int selectByqidCollect(int qId)throws AppException;
	//根据条件查询问题
	public List<Questions> selectByTJ(String qTitle)throws AppException;
}
